# A.6 [5] <�A.9> Using SPIM, write and test an adding machine program that
# repeatedly reads in integers and adds them into a running sum. The program
# should stop when it gets an input that is 0, printing out the sum at that
# point. Use the SPIM system calls described on pages A-43 and A-45.
###############################################################################

#include <sys/syscall.h>
#include <mips/regdef.h>

        .text
        .globl  main


main: 
		subu    sp,sp,24
	    sw	$fp,20(sp)
	    sw	gp,16(sp)
	    move	$fp,sp
        move    t1,zero
        sw      t1,12($fp)

		la      a0, pnum
        li      v0, 4
        syscall

        j	ra
       .data

pnum:   .asciiz "Ingrese un entero (0 termina): \n"
msge:   .asciiz "Resultado acumulado: "
